package org.jeecg.flowable.mapper.definition;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.jeecg.flowable.entity.definition.BpmProcessDefinitionExt;

import java.util.Collection;
import java.util.List;

@Mapper
public interface BpmProcessDefinitionExtMapper extends BaseMapper<BpmProcessDefinitionExt> {

    default List<BpmProcessDefinitionExt> selectListByProcessDefinitionIds(Collection<String> processDefinitionIds) {

        QueryWrapper<BpmProcessDefinitionExt> queryWrapper = new QueryWrapper();
        queryWrapper.in("process_definition_id",processDefinitionIds);
        return selectList(queryWrapper);
    }

    default BpmProcessDefinitionExt selectByProcessDefinitionId(String processDefinitionId) {
        QueryWrapper<BpmProcessDefinitionExt> queryWrapper = new QueryWrapper();
        queryWrapper.eq("process_definition_id",processDefinitionId);
        return selectOne(queryWrapper);
    }

}
